package lab03.test03;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by dell on 2017/11/16.
 */
public class Test {
    public static void main(String[] args) {
        String path="D:\\test.txt";

        FileOutputStream fileOutputStrea=null;
        //字节流写文件
        try {
            fileOutputStrea = new FileOutputStream(path);
            fileOutputStrea.write("北京欢迎你！".getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally{
            try{
                fileOutputStrea.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
